const app = getApp();
Component({
	properties : {
		tabBar : {
			type : [Array, Object],
			value : {}
		}
	},
	data : {
		_tabBar : [],
		color : '#666',
		selectedColor : '#333',
		backgroundColor : '#fff'

	},
	attached (){
		let data = {},
			tabBar = !!this.data.tabBar.length ? this.data.tabBar : app.globalData._tabBar;
			
		data._tabBar = tabBar;

		if(!!tabBar.color) data.color = tabBar.color;
		if(!!tabBar.selectedColor) data.selectedColor = tabBar.selectedColor;
		if(!!tabBar.backgroundColor) data.backgroundColor = tabBar.backgroundColor;

		if(!tabBar.borderStyle || tabBar.borderStyle == 'black'){
			data.borderStyle = 'rgba(213, 213, 213, .8)';
		}else{
			data.borderStyle = '#fff';
		}

		this.setData(data);
	}
})